home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / PNL Libraries / MyGrowZonesAlert.p < prev    next >
Encoding:
Text File  |  1995-12-18  |  838 b   |  43 lines  |  [TEXT/CWIE]

  1. unit MyGrowZonesAlert;
  2.  
  3. interface
  4.  
  5.     procedure StartupGrowZonesAlert;
  6.     procedure ConfigureGrowZonesAlert(alertid: integer);
  7.     
  8. implementation
  9.  
  10.     uses
  11.         MyCleverAlerts, MyGrowZones, MyStartup;
  12.         
  13.     var
  14.         alert_id: integer;
  15.         last_time_was_critical: Boolean;
  16.         
  17.     procedure ConfigureGrowZonesAlert(alertid: integer);
  18.     begin
  19.         StartupGrowZonesAlert;
  20.         alert_id := alertid;
  21.     end;
  22.     
  23.     procedure IdleGrowZonesAlert;
  24.         var
  25.             this_time_was_critical: Boolean;
  26.     begin
  27.         IdleGrowZone;
  28.         this_time_was_critical := MemoryCritical;
  29.         if this_time_was_critical and not last_time_was_critical then begin
  30.             CleverNotifyAlert(alert_id);
  31.         end;
  32.         last_time_was_critical := this_time_was_critical;
  33.     end;
  34.     
  35.     procedure StartupGrowZonesAlert;
  36.     begin
  37.         last_time_was_critical := false;
  38.         StartupGrowZones;
  39.         SetStartup(nil, IdleGrowZonesAlert, 0, nil);
  40.     end;
  41.     
  42. end.
  43.